package com.sychip.fhc.app.data.repo

import com.sychip.fhc.app.data.source.dto.WsnDeviceRssiDto
import kotlinx.coroutines.flow.Flow

interface WsnDeviceRssiRepo {
    fun observeLastRssi(usbId: String): Flow<List<WsnDeviceRssiDto>>
    fun observeOldestDataFrom(usbId: String, dateTime: Long): Flow<List<WsnDeviceRssiDto>>
    fun observeAllDataFrom(usbId: String, dateTime: Long): Flow<List<WsnDeviceRssiDto>>

    fun observeRssiByFromToDev(usbId: String, fromDevId: String,toDevId: String): Flow<List<WsnDeviceRssiDto>>

    suspend fun addRssiData(usbId: String, fromDevId: String, toDevId: String, rssi: String, dateTime: Long):WsnDeviceRssiDto

    suspend fun getAllData(usbId: String = ""): List<WsnDeviceRssiDto>

     suspend fun getAllLastRssi(usbId: String = ""): List<WsnDeviceRssiDto>
    suspend fun getByFromToAndTime(usbId: String, fromDevId: String,toDevId: String,dateTime: Long): List<WsnDeviceRssiDto>

     fun getAllFromDevDataStream(usbId: String, fromDevId: String): Flow<List<WsnDeviceRssiDto>>

    fun getAllToDevData(usbId: String, toDevId:String): Flow<List<WsnDeviceRssiDto>>


    suspend fun deleteAllData(usbId: String):Int

    suspend fun deleteDeviceAllData(usbId: String, devId: String):Int

    suspend fun deleteDataBefore(hours: Int):Int
}